package com.iceGame;

import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.MassData;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;

public class BasicPlatform extends GameObject{

	public static enum PlatformMaterial {ICE, GROUND,ROCKS,METAL,WOOD,GLASS};
	
	public PlatformMaterial _platformMaterial;
	Body body;
	public BasicPlatform(World world, float x, float y, float width, float height,PlatformMaterial type) {
		super(x, y, width, height);
		this._platformMaterial = type;
		setBody(world,x,y,width,height);
	}
	private void setBody(World world,float x,float y,float width,float height){
		BodyDef bodydef = new BodyDef();
		bodydef.position.set(x,y);
		bodydef.type = BodyType.KinematicBody;
		body = world.createBody(bodydef);
		PolygonShape shape = new PolygonShape();
		shape.setAsBox(width/2, height/2);
		body.createFixture(shape, 0.5f);
		MassData data = new MassData();
		data.mass = 5;
		body.setMassData(data);
	}
}
